@echo off
REM ========================================
REM FlorisBoard 清理构建缓存
REM Clean Build Cache
REM ========================================

echo.
echo ===============================================
echo FlorisBoard 清理工具
echo FlorisBoard Clean Tool
echo ===============================================
echo.
echo 此脚本将：
echo This script will:
echo   1. 停止所有 Gradle 守护进程
echo   1. Stop all Gradle daemons
echo   2. 终止所有 Java 进程
echo   2. Kill all Java processes
echo   3. 清理所有构建文件
echo   3. Clean all build files
echo.

pause

echo.
echo [1/3] 停止 Gradle 守护进程...
echo [1/3] Stopping Gradle daemon...
call gradlew.bat --stop

echo.
echo [2/3] 终止 Java 进程以释放文件锁...
echo [2/3] Killing Java processes to release file locks...
taskkill /F /IM java.exe 2>nul

timeout /t 2 /nobreak >nul

echo.
echo [3/3] 清理构建文件...
echo [3/3] Cleaning build files...
call gradlew.bat clean

echo.
echo ===============================================
echo 清理完成！
echo Clean completed!
echo ===============================================
echo.

pause




